package ch03;

public class Pair {
	
	private double firstValue;
	private double secondValue;	
	
	public Pair()
	{
		firstValue = 0;
		secondValue = 0;
	}
	
	public Pair(double aFirst, double aSecond)
	{
		this();
		
		firstValue = aFirst;
		secondValue = aSecond;
	}
	
	public double getSum()
	{
		return firstValue + secondValue;
	}
	
	public double getDifference()
	{
		return firstValue - secondValue;
	}
	
	public double getProduct()
	{
		return firstValue * secondValue;
	}
	
	public double getAverage()
	{
		return (getSum()/2);
	}
	
	public double getDistance()
	{
		return Math.abs(getDifference());
	}
	
	public double getMaximum()
	{
		return Math.max(firstValue, secondValue);
	}
	
	public double getMinimum()
	{
		return Math.min(firstValue, secondValue);
	}

}
